<?php
$directory = "data/";

if (isset($_POST['filename'])&&!empty($_POST['filename']))
{
  $filename = $_POST['filename'];
  $eventfilename = substr($filename, 0, -4).".event";
  $contents = file_get_contents($eventfilename);
  $fp = fopen($directory."trainingseq.dat", 'w');
  fwrite($fp, $contents);
  fclose($fp); 
  
  echo "best algorithm will be saved.";
}
else
{
  echo "error";
}
?>